Skip to content

fix: use stable tmux pane targets#69

Merged
phasetr merged 6 commits into
mainfrom
fix/tmux-pane-target-id
May 16, 2026
Merged

fix: use stable tmux pane targets#69
phasetr merged 6 commits into
mainfrom
fix/tmux-pane-target-id

Conversation

@phasetr
Copy link
Copy Markdown
Owner

@phasetr phasetr commented May 16, 2026

Intent

Fix tmux backend failures for project directories whose tmux window names contain target syntax characters such as dots. A window named dr-remote.jp was being passed to tmux as session:dr-remote.jp; tmux interpreted .jp as a pane selector, so mirror refresh reported [tmux pane closed] even though the pane was alive.

Also restore the expected workspace ergonomics: after setup or workspace switching, apply the current project's example window layout automatically when enkan-repl-setup-current-project-layout is loaded.

Finally, handle layout resolution when a session entry uses an alias whose real project name differs, such as er -> enkan-repl.

Changes

  • Keep window names for Emacs-side metadata and buffer naming.
  • Store stable tmux %pane_id in enkan tmux identifiers when available.
  • Normalize tmux command targets such as send-keys, capture-pane, cwd lookup, kill, and alert capture to %pane_id.
  • Preserve legacy session:window IDs for existing state and tests.
  • Run the optional current-project layout command after successful setup.
  • Run the optional current-project layout command after workspace switch state is loaded.
  • Cover both direct workspace switching and workspace-list switching.
  • Cover the implicit switch that happens after deleting the current workspace and loading a remaining workspace.
  • Resolve layout session entries as either real project names or configured aliases.

Test plan

  • make test (274 tests)
  • make compile
  • Byte compile examples/window-layouts.el with warnings as errors
  • Byte compile enkan-repl-workspace-list.el with warnings as errors
  • Regression tests added:
    • test-enkan-repl--terminal-tmux-start-dotted-window-uses-pane-id
    • test-enkan-repl--terminal-tmux--capture-pane-async-targets-pane-id
    • test-enkan-repl-setup-creates-workspace-standard-file
    • test-enkan-repl-setup-creates-workspace-center-file
    • test-enkan-repl-workspace-switch-runs-current-project-layout
    • test-workspace-list-switch-runs-current-project-layout
    • test-workspace-delete-current-runs-current-project-layout
    • test-workspace-layout-resolves-session-alias-to-project-name
  • Manual tmux check: started /Users/sekine/dev/offisis/dr-remote.jp/, got id enkan-fix-test-97:dr-remote.jp|%29, verified capture via target %29.

@phasetr phasetr merged commit 67cdbe0 into main May 16, 2026
1 check passed
@phasetr phasetr deleted the fix/tmux-pane-target-id branch May 16, 2026 12:55
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 0.19.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants